import axios from "axios";

export const login = async(username,password)=> {
    console.log('API Base URL:', process.env.VUE_APP_API_BASE_URL); // 调试输出
    try {
        const response = await axios.post(`${process.env.VUE_APP_API_BASE_URL}/api/login`, {
            username,
            password
        });
        console.log('API 响应:', response.data); // 调试日志
        return response.data;
    } catch (error) {
        console.error('API 错误:', error); // 调试日志
        throw error;
    }
}